package com.jenkins.test.function;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * @version V1.0.0
 * @ClassName: {@link AwardService}
 * @Description: AwardService
 * @author: Lanzhou
 * @date: 2022/1/20 11:42
 * @Copyright:2020 All rights reserved.
 */
@Service
public class AwardService {


    @Value("${project.axis}")
    private int projectAxis;

    @Value("${year.axis}")
    private int yearAxis;

    @Value("${quarter.axis}")
    private int quarterAxis;

    /**
     * 项目
     *
     * @param project 项目
     * @return
     */
    @AwardType
    public String project(String project) {
        int money = projectAxis * 2 + 6;
        return project + "的项目奖金: {" + money + "} 计算公式为: y = 2x + b";
    }

    /**
     * 年终
     *
     * @param year 年
     * @return
     */
    @AwardType(Constant.TYPE_YEAR)
    public String endYear(String year) {
        int money = yearAxis * 3 + 2;
        return year + "年年终奖金: {" + money + "} 计算公式为: y = 3x + a";
    }

    /**
     * 季度
     *
     * @param quarter 季度
     * @return
     */
    @AwardType(Constant.TYPE_QUARTER)
    public String quarter(String quarter) {
        int money = quarterAxis * 4 + 8;
        return quarter + "季度的奖金: {" + money + "} 计算公式为: y = x/4 + c";
    }


}
